package com.java.simple.smallspring.bean;

import java.util.HashMap;
import java.util.Map;

/**
 * @author zhoujunlin
 * @date 2022年08月19日 16:19
 * @desc
 */
public class UserDao {

    private static final Map<String, String> userMap = new HashMap<>();

    /*static {
        userMap.put("10001", "张三");
        userMap.put("10002", "里斯");
        userMap.put("10003", "王五");
    }*/

    public void initDataMethod() {
        System.out.println("执行：init-method");
        userMap.put("10001", "张三");
        userMap.put("10002", "里斯");
        userMap.put("10003", "王五");
    }

    public void destroyDataMethod() {
        System.out.println("执行：destroy-method");
        userMap.clear();
    }


    public String queryUserName(String uId) {
        return userMap.get(uId);
    }

}
